{template 'member','header'}
<div id="main">
{template "member","left"}
  <div id="right">
  <p id="position"><strong>当前位置：</strong><a href="">首页</a><a href="{$M[url]}member.php">我的广告</a><a>编辑广告</a><a>{$_ads[adsname]}</a></p>
    <script type="text/javascript" src="images/js/validator.js"></script>
    <form action="{$M[url]}member.php?action={$action}&adsid={$adsid}&dosubmit=1" method="post" name="myform" enctype="multipart/form-data">
      <table cellpadding="0" cellspacing="1" class="table_form">
        <caption>
        编辑广告
        </caption>
        <tr>
          <th width="150"><strong>广告位</strong></th>
          <td> {$placeid} <font color="red">*</font> </td>
        </tr>
        <tr>
          <th><strong>名称</strong></th>
          <td><input size=40 name="ads[adsname]" type="text" value="{$_ads[adsname]}" require='true' datatype='limit' min='5' msg='广告名称最少5个字!'>
            <font color="red">*</font> </td>
        </tr>
        <tr>
          <th><strong>介绍</strong></th>
          <td><input size=60 name="ads[introduce]" type="text" value="{$_ads[ads_introduce]}">
          </td>
        </tr>
        <tr>
          <th><strong>类型</strong></th>
          <td><input type='radio' name='ads[type]' value='image' onclick="alterUC('imageid')" {if $_ads[type]=='image'}checked{/if}>
            图片
            <input type='radio' name='ads[type]' value='flash' onclick="alterUC('flashid')" {if $_ads[type]=='flash'}checked{/if}>
            FLASH
            <input type='radio' name='ads[type]' value='text' onclick="alterUC('textid')" {if $_ads[type]=='text'}checked{/if}>
            文本
            <input type='radio' name='ads[type]' value='code' onclick="alterUC('codeid')" {if $_ads[type]=='code'}checked{/if}>
            文字链 <font color="red">*</font> </td>
        </tr>
        <tr>
          <th><strong>内容</strong></th>
          <td><table cellpadding="0" cellspacing="0" id="table">
              <tbody id="imageid" style="display:none">
                <tr>
                  <td> 上传图片：&nbsp;{$thumb}
                    <input type='hidden' name="ads[imageurl]" value="{$_ads[imageurl]}">
                    <font color="red">*</font><br/>
                    图片提示：
                    <input type="text" name="ads[alt]" size="50" value="{$_ads[alt]}">
                    <br/>
                    链接地址：
                    <input name="ads[linkurl]" type="text" size="50" value="{$_ads[linkurl]}">
                    <font color="red">*</font><br />
                    上传图片1：{$thumb1}
                    <input type='hidden' name="ads[s_imageurl]" value="{$_ads[s_imageurl]}">
                    <br />
                    (第二张图片当广告为随屏移动广告或者对联广告的时有效) </td>
                </tr>
              </tbody>
              <tbody id="flashid" style="display:none">
                <tr>
                  <td> FLASH地址：&nbsp;{$flash}
                    <input type='hidden' name="ads[flashurl]" value="{$_ads[flashurl]}">
                    <font color="red">*</font><br/>
                    背景透明：
                    <input type='radio' name='ads[wmode]' value='transparent' {if $_ads['wmode']=='transparent'}checked{/if}>
                    是
                    <input type='radio' name='ads[wmode]' value='' {if $_ads['wmode']==''}checked{/if}>
                    否 </td>
                </tr>
              </tbody>
              <tbody id="textid" style="display:none">
                <tr>
                  <td><textarea name='ads[text]' cols='64' rows='15' id='text'>{$_ads[text]}</textarea>
                    <font color="red">*</font> </td>
                </tr>
              </tbody>
              <tbody id="codeid" style="display:none">
                <tr>
                  <td>链接内容：
                    <input type='text' name='ads[code]' size=40 value='{$_ads[code]}'>
                    <font color="red">*</font><br />
                    链接地址：
                    <input type='text' name='ads[text_link]' size=40 value='{$_ads[linkurl]}'>
                    <font color="red">*</font> </td>
                </tr>
              </tbody>
            </table></td>
        </tr>
        <tr>
          <td></td>
          <td><input type="submit" name="submit" value=" 修改 ">
            &nbsp;
            <input type="reset" name="reset" value=" 清除 ">
          </td>
        </tr>
      </table>
    </form>
  </div>
</div>
<script>
function alterUC(eID) {
	$("#table tbody").hide();
	$("#"+eID).show();
}
alterUC("{$_ads[type]}id");
$('form').checkForm(1);
$('form').checkForm(1);
</script>
{template 'phpcms','footer'}